<template>
	<div id="app">
		<router-view></router-view>
	</div>
</template>

<script>
	// 导入vue动画样式
	import 'vue2-animate/dist/vue2-animate.min.css';
	import '@/assets/strive.scss';
	
	export default {
		name: 'app',
		components: {},
		computed: {
			routeName() {
				return this.$route.name
			}
		},
		watch: {
			routeName() {
				if (this.routeName !== 'login' && this.routeName !== 'register') {
					let token = localStorage.getItem(this.$config.tokenName)
					if(!token){
						this.$router.replace({name: 'login'})
					}
				}
			}
		}
	}
</script>

<style>	
	html,
	body, #app {
		height: 100%;
		width: 100%;
		margin: 0;
		padding: 0;
		font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
	}
</style>
